/* (C)oded by ESPRIT 2014 - 3B2 - Undrained Group*/
/* Par: Joumen Harzli & Marouen Ben Outhman*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int ord(char str)
{
    int x = ((int)  str);
    return   x;
}

void cryptage(char chaine[])
 {
      int  i,n,x,k;
      char c;
	k= 1;
      n=strlen(chaine);
      for (i=0;i<n;i++)
      {
          x=ord(chaine[i]);
            x=x + k;
	k++;
            c = ord(x);
            chaine[i]=c;
      }
}

void decryptage(char chaine[])
{
      int  i,n,x,k;
      char c;
	k = 1;
      n=strlen(chaine);
      for (i=0;i<n;i++)
      {
          x=ord(chaine[i]);
            x=x - k;
		k++;
            c = ord(x);
            chaine[i]=c;
      }
}
